<?php

class KeyResources extends CFormModel {
	public $keyResources;
	
	public function rules() {
		return array(
			array('keyResources','required'),
		);
	}
	
	public function attributeLabels() {
		return array(
			'answer'=>'Describe your business resources',
		);
	}
	
	public function getForm() {
		return new CForm(array(
			'showErrorSummary'=>true,
			'attributes'=>array('id'=>'survey'),
			'elements'=>array(
				'keyResources'=>array(
					'type'=>'checkboxlist',
					'items'=>CHtml::listData(BusinessResources::model()->findAll(), 'id', 'name'),
					'attributeitem' => 'id',
					'separator'=>'<br>',
					'labelOptions'=>array('style'=>'display:inline;'),
					'layout'=>'{label}<br/>{input}<br/>{error}',
				),
			),
			'buttons'=>array(
				'submit'=>array(
					'type'=>'submit',
					'label'=>'Finish'
				)
			)
		), $this);
	}
}